package com.mysnail.controller;

import com.mysnail.User;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

import java.util.ArrayList;
import java.util.List;

@Controller
public class ListController {
    @RequestMapping(value = "cp2")
    public ModelAndView list(){
        ModelAndView mv = new ModelAndView("cp2");
        //User user = new User();
        List<String> list = new ArrayList<>();
        list.add("java");
        list.add("pyhon");
        list.add("js");
        list.add("c#");
        mv.addObject("mylist",list);
        return mv;
    }
}
